﻿@model Razor.Models.Product

@{
    ViewBag.Title = "DemoExpression";
}

<table>
    <thead>
        <tr><th>Property</th><th>Value</th></tr>
    </thead>
    <tbody>
        <tr><td>Name</td><td>@Model.Name</td></tr>
        <tr><td>Price</td><td>@Model.Price</td></tr>
        <tr>
            <td>Stock Level</td>
            <td>@ViewBag.ProductCount</td>
            <td>
                @switch ((int) ViewBag.ProductCount)
                {
                    case 0:
                        @: Out of Stock
                        break;
                    case 1:
                        <b>Low Stock (@ViewBag.ProductCount)</b>
                        break;
                    default:
                        @ViewBag.ProductCount
                        break;
                }
            </td>
        </tr>
    </tbody>
</table>

<div data-discount="@ViewBag.ApplyDiscount" data-express="@ViewBag.ExpressShip" data-supplier="@ViewBag.Supplier">
    The containing element has data attributes
</div>
Discount:
<input type="checkbox" checked="@ViewBag.ApplyDiscount" />
Express:
<input type="checkbox" checked="@ViewBag.ExpressShip" />
Supplier:
<input type="checkbox" checked="@ViewBag.Supplier" />
